<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<%@include file="/common/javascript.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>vm列表</title>
    
    <script type="text/javascript">
    	var dialog;
        var gridManager = null;
        $(function ()
        {
 
        	$(".l-toolbar-item").hover(
            	function (){
                   $(this).addClass("l-panel-btn-over");
               }, function (){
                   $(this).removeClass("l-panel-btn-over");
            });
            	
            $(".l-toolbar-item").click(function(){
            	toolbarBtnItemClick($(this));
            });
            
            $("#maingrid").ligerGrid({
                columns: [
				{ display: '虚机id', name: 'id', align: 'left', width:'15%', minWidth: 60 },
                { display: '虚机ip', name: 'ip', align: 'left', width:'20%', minWidth: 60 },
                { display: '虚机端口', name: 'port', width:'15%',minWidth: 120 },
                { display: '虚拟密码', name: 'pwd',width:'15%', minWidth: 120 },
                {
                    display: '操作', isAllowHide: false,
                    render: function (row)
                    {
                        var html = '<a href="javascript:void(0);" onclick="connectVm(\'' + row.id + '\')">登陆</a>';
                        return html;
                    }
                }
                ], dataAction: 'server', url: '${ctx}/qso/teach/getVm', sortName: 'vmIp',
                width: '100%', height: '100%', numPerPage:20,rownumbers:true,
                checkbox : true,
                heightDiff: -6
            });
            gridManager = $("#maingrid").ligerGetGridManager()
            $("#pageloading").hide();
        });

        function connectVm(vmId) {
        	this.parent.teaVmWin=window.open('${ctx}/qso/teach/connectVm/'+vmId,"teaVmWin","height=600,width=950,left=200,top=50,scrollbars=yes,resizable=yes");
        	var parent=window.parent;
            if (parent && parent.closeVmDialog)
            {
            	parent.closeVmDialog();
            }
        }

        function reload(){
        	gridManager.loadData();
        }
    </script>
</head>
<body style="padding:0px; overflow:hidden;"> 
<div class="l-loading" style="display:block" id="pageloading"></div>
<div id="maingrid" style="margin:0; padding:0"></div>

<div style="display:none;"></div>
 
</body>
</html>
